/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-07-21
 * Time: 15:28
 * To BE A Better Person-2020-3-2
 */
public class TestDemo {
    public static long Num=20_0000_0000;
    public static void Add() throws InterruptedException {
        long st=  System.currentTimeMillis();
        Thread t1= new Thread(()->{
            int a=0;
            for (int i = 0; i < Num; i++) {
                a++;
            }
        });
        Thread t2=new Thread(()->{
            int a=0;
            for (int i = 0; i < Num; i++) {
                a++;
            }
        });
        try{
        t1.join();
        t2.join();
        }
        catch (InterruptedException e){
            e.printStackTrace();
        }
        long et=System.currentTimeMillis();
        System.out.println(et-st);
    }
    public static void AddNor(){
        long st=  System.currentTimeMillis();
        int a=0;
        for (int i = 0; i < Num; i++) {
            a++;
        }
        a=0;
        for (int i = 0; i < Num; i++) {
            a++;
        }
        long et=System.currentTimeMillis();
        System.out.println(et-st);
    }
    public static void main(String[] args) throws InterruptedException {
        AddNor();
        //Add();
    }
}
